package com.lw.carmanage.controller;

import com.lw.carmanage.dto.R;
import com.lw.carmanage.pojo.SysUser;
import com.lw.carmanage.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author Administrator
 * @version 1.0
 * @description:
 * @date 2022/3/31 10:09
 */
@RestController
@RequestMapping("/users")
public class SysUserController {

    private SysUserService userService;

    @Autowired
    public void setUserService(SysUserService userService) {
        this.userService = userService;
    }


    @PostMapping("/registry")
    public R registry(@RequestBody SysUser user){
        userService.addUser(user);
        return R.setOK();
    }
}
